package com.usian.feign;

import com.usian.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "eureka-provider")
public interface UserFeign {

    @RequestMapping("/findAll")
    public List<User> findAll();

    @RequestMapping("/getUserById")
    public User getUserById(@RequestParam Integer id);

    @RequestMapping("/findByName")
    public User findByName(@RequestParam String name);

    @RequestMapping("/findUser")
    public User findUser(@RequestBody User user);
}
